﻿#pragma once

#include "HttpService.h"
#include <string>
#include <iostream>
#include <stdexcept>
#include "../../stringhelper.h"
#include "../../tangible_filesystem.h"

using namespace Server::MirEnvir;
namespace S = ServerPackets;

namespace Server::Library::Utils
{
    class HttpServer : public HttpService
    {
    private:
        Thread *_thread;

    public:
        virtual ~HttpServer()
        {
            delete _thread;
        }

        HttpServer();

        void Start();

        void Stop();


        void OnGetRequest(HttpListenerRequest *request, HttpListenerResponse *response) override;

    private:
        void AddNameList(const std::string &playerName, const std::string &fileName);

    public:
        void OnPostRequest(HttpListenerRequest *request, HttpListenerResponse *response) override;
    };

}
